import store from '@/store/index.js'
export const shareMixins = {
    data () {
        return {
            shareData: {
                title: '',
                path: '',
                imageUrl: '',
                content: '',
                desc: ''
            }
        }
    },

    //#ifdef MP-WEIXIN   
    onShareAppMessage () {
		let shareInfo = store.getters.shareData
		let shareUrl = shareInfo.path
		if(shareUrl.includes('?')){
			shareUrl = shareUrl+'&isShare=1'
		}else{
			shareUrl = shareUrl+'?isShare=1'
		}
        return {
            title: shareInfo.title,
            path: shareUrl,
            imageUrl: shareInfo.imgUrl,
            content: shareInfo.content,
            desc: shareInfo.desc,
            success: res => {
                console.info(res,'小程序分享参数',shareInfo)
            }
        }
    },
    //#endif

    onLoad(option) {
    }
}